'use strict';
const db = uniCloud.database();
const accounts = db.collection('Accounts')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	let accountId = await accounts.add(event);
	
	//返回数据给客户
	
	if(!accountId){
		return {
			code:400,
			msg:"注册失败"
		}
	}
	
	return {
		code:200,
		accountId
	}
};
